class Solution(object):
    def canJump(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        max_ = 0
        for i in range(0, len(nums)):
            count = i+nums[i]
            max_ = max(max_, count)
            if max_ >= len(nums)-1:
                return True
            if max_ < i+1:
                return False
        return False